package com.lngsyz.ywtb.entity;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**  
 * Description: http请求返回对象
 * Created by yangbk on 2019/04/13.
 */
@ApiModel(value = "result",description = "包装信息")
public class URIResult<T> implements Serializable {

	private static final long serialVersionUID = 1L;
    public static final URIResult<String> SUCCESS = new URIResult<String>(1,"请求成功");
    public static final URIResult<String> FAIL = new URIResult<String>(0,"请求失败");
    
    @ApiModelProperty(value = "版本号",required = true,example = "1.0")
    private final String ver = "1.0";
    @ApiModelProperty(value = "返回代码：1-成功；0-失败；",required = true,example = "0")
    private int code = 0;
    @ApiModelProperty(value = "返回信息",required = false,example = "请求成功")
    private String info = "请求成功";
    @ApiModelProperty(value = "返回详情",required = false,example = "异常信息")
    private String msg;
    
    @ApiModelProperty(value = "返回数据",required = false)
    private T data;

    @ApiModelProperty(value = "数据总数",required = false,example = "0")
    private long total = 0;

    public URIResult() {
		super();
    }
    
    public URIResult(int code, String info) {
		super();
		this.code = code;
		this.info = info;
	}


    /**
     * @return code
     */
    public int getCode() {
        return code;
    }

    /**
     * @param code 要设置的 code
     */
    public void setCode(int code) {
        this.code = code;
    }

    /**
     * @return info
     */
    public String getInfo() {
        return info;
    }

    /**
     * @param info 要设置的 info
     */
    public void setInfo(String info) {
        this.info = info;
    }

    /**
     * @return msg
     */
    public String getMsg() {
        return msg;
    }

    /**
     * @param msg 要设置的 msg
     */
    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * @return data
     */
    public T getData() {
        return data;
    }

    /**
     * @param data 要设置的 data
     */
    public void setData(T data) {
        this.data = data;
    }

    /**
     * @return total
     */
    public long getTotal() {
        return total;
    }

    /**
     * @param total 要设置的 total
     */
    public void setTotal(long total) {
        this.total = total;
    }

    /**
     * @return ver
     */
    public String getVer() {
        return ver;
    }
    
}
